import Login from '@/views/Login.vue'
import Home from '@/views/Home.vue'

const routes = [{
    path: '/',
    redirect: '/home/controlpanel'
}, {
    path: '/login',
    name: 'login',
    component: Login,
    meta: { title: '用户登录' }
}, {
    path: '/home',
    name: 'home',
    component: Home,
    meta: { title: 'CMS首页' },
    //二级
    children: [{
        path: '',
        redirect: '/home/controlpanel'
    },
    {
        path: 'xinzeng',
        name: 'xinzeng',
        component: () => import(/*webpackChunkName:"home"*/'@/views/Xinzeng.vue'),
        meta: { title: '新增商品', code: '0x104', icon: 'el-icon-plus' }
    },

    {
        path: 'controlpanel',
        name: 'controlpanel',
        component: () => import(/*webpackChunkName:"home"*/'@/views/ControlPanel.vue'),
        meta: { title: '控制面板', code: '0x100', icon: 'el-icon-menu' }
    },
    {
        path: 'bannersetting',
        name: 'bannersetting',
        component: () => import(/*webpackChunkName:"home"*/'@/views/Home/BannerSetting'),
        meta: { title: '轮播图设置', code: '0x101', icon: 'el-icon-picture-outline' }
    }, {
        path: 'goodssetting',
        name: 'goodssetting',
        component: () => import(/*webpackChunkName:"home"*/'@/views/Home/GoodsSetting'),
        meta: { title: '热销商品', code: '0x101', icon: 'el-icon-wallet', configType: 3 }
    }, {
        path: 'productsetting',
        name: 'productsetting',
        component: () => import(/*webpackChunkName:"home"*/'@/views/Home/ProductSetting'),
        meta: { title: '新品上线', code: '0x101', icon: 'el-icon-position', configType: 4 }
    }, {
        path: 'recommendsetting',
        name: 'recommendsetting',
        component: () => import(/*webpackChunkName:"home"*/'@/views/Home/RecommendSetting.vue'),
        meta: { title: '为你推荐设置', code: '0x101', icon: 'el-icon-thumb', configType: 5 }
    }, {
        path: 'classification',
        name: 'classification',
        component: () => import(/*webpackChunkName:"home"*/'@/views/ClassiFication.vue'),
        meta: { title: '分类管理', code: '0x102', icon: 'el-icon-tickets' }
    }, {
        path: 'goodsmanager',
        name: 'goodsmanager',
        component: () => import(/*webpackChunkName:"home"*/'@/views/GoodsManager.vue'),
        meta: { title: '商品管理', code: '0x103', icon: 'el-icon-shopping-cart-full' }
    }, {
        path: 'membermanager',
        name: 'membermanager',
        component: () => import(/*webpackChunkName:"home"*/'@/views/MemberManager.vue'),
        meta: { title: '会员管理', code: '0x104', icon: 'el-icon-user' }
    }, {
        path: 'ordermanager',
        name: 'ordermanager',
        component: () => import(/*webpackChunkName:"home"*/'@/views/OrderManager.vue'),
        meta: { title: '订单管理', code: '0x105', icon: 'el-icon-s-order' }
    }, , {
        path: 'order-detail',
        name: 'order-detail',
        component: () => import(/* webpackChunkName:'order-manager' */'@/views/OrderDetail.vue'),
        meta: { title: '订单详情', code: '0x105' }
    }]
}, {
    path: '*',
    redirect: '/home/controlpanel'
}];
export default routes;